<?php
class post
{
    public function getAll()
    {
        $result = array();
        $db = db::getDb();
        if ($q = $db->execute("SELECT * FROM `k_post`")) {
            $result = $q;
        }
        return $result;
    }

    public function getOne($id = '')
    {
        $result = array();
        $db = db::getDb();
        if ($q = $db->execute("SELECT * FROM `k_post` WHERE `id` = '$id'")) {
            $result = $q[0];
        }
        return $result;
    }
}